//
//  BVGoodsDetailViewController.m
//  BuyVegetable
//
//  Created by yushanchang on 16/10/4.
//  Copyright © 2016年 com.yinding. All rights reserved.
//  商品详情页

#import "BVGoodsDetailViewController.h"
#import "BVGoodsHeaderCell.h"
#import "BVCategoryViewController.h"
#import "BVTabBarController.h"
#import "UIImage+GIF.h"
#define GOODSDETAIL_CELL_IDENTIFIER @"BVGoodsHeaderCell"

@interface BVGoodsDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation BVGoodsDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationItem setTitle:@"商品详情"];
  
}

- (void)setTableView:(UITableView *)tableView {
    _tableView = tableView;
    [tableView registerNib:NIB_NAMED(GOODSDETAIL_CELL_IDENTIFIER) forCellReuseIdentifier:GOODSDETAIL_CELL_IDENTIFIER];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
//    return 5;
    if (section == 0) {
        return 0;
    } else {
        return 0;
    }
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 210;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    BVGoodsHeaderCell *header_cell = [tableView dequeueReusableCellWithIdentifier:GOODSDETAIL_CELL_IDENTIFIER];
    
    return header_cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (IBAction)shoppingCartClick:(id)sender {
    
    [self.navigationController popToRootViewControllerAnimated:NO];
    BVTabBarController *tabBarVc = (BVTabBarController *)BVKeyWindow.rootViewController;
    tabBarVc.selectedIndex = 2;
    tabBarVc.tabBar.translucent = NO;
}

@end
